﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StateGrid
{
    class CRepository
    {
        public bool hasGroup
        {
            get;
            set;
        }
        /*
         * 当hasGroup时，CRepository通过CGroup来操作articals
         * 当！hasGroup时，CRepository自己操作articals
         */
        public ArrayList articals;
        public CArtical currentArtical;
        public CArtical metaArtical;    //用于保存ArticalFrame

        public ArrayList groups;
        public CGroup currentGroup;
        public CGroup metaGroup;        //用于保存GroupFrame

        public CAttribute attributes;
        public string repositoryName;
        /*
         * 读入并设置该文库的属性，在进入文库时调用一次，其他可复用对象或用对象赋值
         * 需在生成录入界面之前调用
         */
        public void genFrame()
        {
            // 1. read in hasGroup

            // 2. read in repository attibutes

            // 3. call group.genFrame if hasGroup, or else call artical.genFrame
            if (hasGroup)
                metaGroup.genFrame();
            else
                metaArtical.genFrame();
        }

        /*
         * 以下操作用于新增一种repository时用到的
         */

    }
}
